<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="../common.jsp" %>
<jsp:include page="safe.jsp"/>
<%@ page  import=" java.util.*" %>
<link href="../CSS/style.css" rel="stylesheet">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
request.setCharacterEncoding("utf-8");
if(request.getParameter("content")!="" && request.getParameter("content")!=null){
	String content=request.getParameter("content");
        
         Calendar ca = Calendar.getInstance();
      int year = ca.get(Calendar.YEAR);//获取年份
      int month=ca.get(Calendar.MONTH);//获取月份 
      int day=ca.get(Calendar.DATE);//获取日
      
       Date date=new Date(year,month, day);
        Bbs bbs=new Bbs();
        bbs.setContent(content);
        bbs.setIntime(date);
        int ret=bookDB.addBBS(bbs);
	if (ret==0){
		out.println("<script language='javascript'>alert('公告信息添加成功！');window.location.href='BBSManage.jsp';</script>");
		}else{
		out.println("<script language='javascript'>alert('公告信息添加失败！');window.location.href='BBSManage.jsp';</script>");
	}
}
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../CSS/style.css" rel="stylesheet">
    </head>
   <script language="javascript">
function mycheck(){
	if (form1.content.value==""){
		alert("请输入公告内容！");form1.content.focus();return;
	}
	form1.submit();
}
</script>
<body>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" background="../Images/bg.gif">
  <tr>
    <td>
<table width="777" height="609"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td valign="top">
	<jsp:include page="Top.jsp"/>
	<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="tableBorder_LTR">
      <tr>
        <td height="30" align="center" bgcolor="#eeeeee">≡≡≡ <a href="BBSManage.jsp">公告管理</a> ≡≡≡</td>
      </tr>
    </table>
	<table width="100%" height="396"  border="0" cellpadding="0" cellspacing="0" class="tableBorder_LBR">
        <tr>
          <td width="26%" height="395" valign="top"><table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
            <tr>
              <td width="55%" height="82" align="center" class="word_grey">&nbsp;<img src="../Images/reg.gif" width="84" height="54"></td>
              <td width="45%" align="left" class="word_grey">添加公告信息</td>
            </tr>
            <tr>
              <td height="112" colspan="2" valign="top" class="word_grey"><ul>
                  <li>公告信息不可修改，只可添加和删除。</li>
                  <li> 添加公告信息：点击“添加公告信息”超链接可以进行公告信息的添加。</li>
                  <li>删除图书信息：点击每条图书信息后面的“删除”按钮可以删除图书信息。</li>
                  </ul></td>
            </tr>
            <tr align="center">
              <td colspan="2" valign="middle" class="word_grey"></td>
            </tr>
          </table></td>
          <td width="5" valign="top" background="../Images/Cen_separate.gif"></td>
          <td width="73%" valign="top"><table width="100%" height="56"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td align="center">&nbsp;</td>
            </tr>
            <tr>
              <td align="center">
			  <form action="BBS_add.jsp" method="post" name="form1">
			    <table width="100%"  border="0" align="center" cellpadding="-2" cellspacing="-2" bordercolordark="#FFFFFF">
                             <tr>
                    <td width="14%" height="272">&nbsp;公告内容：</td>
                    <td width="86%">
                        <textarea name="content" cols="60" rows="15" class="textarea"></textarea></td>
                  </tr>
                  <tr>
                    <td height="38" colspan="2" align="center">
                        <input name="Button" type="button" class="btn_grey" value="保存" onClick="mycheck()">
&nbsp;                        
<input name="Submit2" type="reset" class="btn_grey" value="重置">
                        &nbsp;
                        <input name="Submit3" type="button" class="btn_grey" value="返回" onClick="JScript:history.back()">
                    </td>
                  </tr>
                </table>
			  </form>
			  </td>
            </tr>
          </table></td>
        </tr>
      </table>
      <jsp:include page="copyright.jsp"/>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
</body>
</html>